<?php
class YouNet_Form_Element_RichEditor extends Zend_Form_Element_Textarea
{
	const EDITOR_OPTIONS = 'editorOptions';
	
	public $helper = 'formRichEditor';
	
	public function init()
	{
		parent::init();
		if( !$this->getAttrib(self::EDITOR_OPTIONS) )
		{
			 
			if( !$this->getAttrib('theme') )
			{
				$config	= new Zend_Config_Ini(APPLICATION_PATH . '/configs/tinymce.ini', 'advanced');
			}
			else
			{
				$config	= new Zend_Config_Ini(APPLICATION_PATH . '/configs/tinymce.ini', $this->getAttrib('theme'));
			}
			$this->setAttrib(self::EDITOR_OPTIONS,$config);
		}
		$this->addFilter(new YouNet_Filter_Purifier());
	}
}
